#include <memctrl.h>
#include <memctrl_v2.h>
#include <mmio.h>
+#include <smmu.h>
#include <string.h>
#include <tegra_def.h>
#include <xlat_tables.h>
};
/*
- * Init SMMU.
+ * Init Memory controller during boot.
*/
void tegra_memctrl_setup(void)
{
INFO("Tegra Memory Controller (v2)\n");
/* Program the SMMU pagesize */
- val = tegra_smmu_read_32(ARM_SMMU_GSR0_SECURE_ACR);
- val |= ARM_SMMU_GSR0_PGSIZE_64K;
- tegra_smmu_write_32(ARM_SMMU_GSR0_SECURE_ACR, val);
+ tegra_smmu_init();
/* Program all the Stream ID overrides */
for (i = 0; i < num_overrides; i++)
}
}
+}
+/*
+ * Restore Memory Controller settings after "System Suspend"
+ */
+void tegra_memctrl_restore_settings(void)
+{
/* video memory carveout region */
if (video_mem_base) {
tegra_mc_write_32(MC_VIDEO_PROTECT_BASE_LO,
.cgid_tag = MC_TXN_OVERRIDE_ ## val \
}
-/*******************************************************************************
- * Memory Controller SMMU Global Secure Aux. Configuration Register
- ******************************************************************************/
-#define ARM_SMMU_GSR0_SECURE_ACR 0x10
-#define ARM_SMMU_GSR0_PGSIZE_SHIFT 16
-#define ARM_SMMU_GSR0_PGSIZE_4K (0 << ARM_SMMU_GSR0_PGSIZE_SHIFT)
-#define ARM_SMMU_GSR0_PGSIZE_64K (1 << ARM_SMMU_GSR0_PGSIZE_SHIFT)
-
/*******************************************************************************
* Structure to hold the Stream ID to use to override client inputs
******************************************************************************/
mmio_write_32(TEGRA_MC_STREAMID_BASE + off, val);
}
-static inline uint32_t tegra_smmu_read_32(uint32_t off)
-{
- return mmio_read_32(TEGRA_SMMU_BASE + off);
-}
-
-static inline void tegra_smmu_write_32(uint32_t off, uint32_t val)
-{
- mmio_write_32(TEGRA_SMMU_BASE + off, val);
-}
-
#endif /* __MEMCTRLV2_H__ */